/**
 * Created by wxm on 2017/8/13.
 */
var OP_NUM = sessionStorage.getItem("machCode");
$(document).ready(function () {
    var time = 90;
    var timer = window.setInterval(function () {
        $("#timer_number").text(time--);
        var workStatePath = "vms/work/state";
        var workStateParams = {
            "DEVICE_ID":OP_NUM,
            "STORE_ID":STORE_ID
        };
        request(workStatePath,workStateParams,function (res){
            
            if(res.BODY.WORK_STATE == 0 || time < 0) {
                clearInterval(timer);
                var orderId = location.search;
                location.replace("./make_complete.html" + orderId);
            }
        })
    },1000);
})